//引入封装好的接口
import { getMenuList } from "../../../request/api";
//state
const state = {
  menulist: [],
};
//getters
const getters = {
  getMenu(state) {
    return state.menulist;
  },
};
//mutations
const mutations = {
    REQ_MENULIST(state,payload){
        state.menulist = payload
    }
};
//actions
const actions = {
  getMenuAction({commit}) {
    getMenuList().then((res) => {
    //   console.log(res, "rrrrrrrrrr");
    commit('REQ_MENULIST',res.list)
    });
  },
};

export default {
  state,
  getters,
  mutations,
  actions,
  //命名空间
  namespaced: true,
};
